package com.spring.demo.util;

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

/**
 * 日期工具
 * 
 * @author sean
 * 
 */
public class DateUtil {

	public static final Locale LOCALE = Locale.CHINA;

	/**
	 * 获取当前时间
	 * 
	 * @return
	 */
	public static Date now() {
		return calendar().getTime();
	}

	public static Date dateAddMillseconds(Date date, long millseconds) {

		Calendar c = calendar();
		c.setTimeInMillis(date.getTime() + millseconds);
		return c.getTime();
	}

	public static Calendar calendar() {
		return Calendar.getInstance(LOCALE);
	}
}
